package com.cky.forum.controller;

import com.cky.forum.common.AppResult;
import com.cky.forum.exception.ApplicationException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class TestController {
    @RequestMapping("hello")
    public String hello(){
        return "hello,spring boot......";
    }
    @GetMapping("/exception")
    public AppResult testException() throws Exception {
        throw new Exception("这是一个Exception...");
    }
    @GetMapping("/appException")
    public AppResult testApplicationException(){
        throw new ApplicationException("这是一个Application...");
    }
}
